# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-geotext
pkgname=('python2-geotext' 'python-geotext')
_pkgname=geotext
pkgver=0.4.0
pkgrel=6
pkgdesc='Geotext extracts country and city mentions from text.'
arch=('any')
url='https://pypi.org/project/geotext/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('30ffd2c52359c9b1ac8e83d659e1ad0036b51a1716cc8f286bce60153a2455419f7d2f19481b4e5714b51b668b12fed19a3d53d5d992097bf462b99cee8f839c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-geotext() {
  depends=('python2' 'python2-wheel')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-geotext() {
  depends=('python' 'python-wheel')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

